Skip to main content

mobileAdCreate

Type

command

Summary

Place an ad of the given type

Syntax

mobileAdCreate <ad>, [<type>], [<topLeft>], [<metaData>]

Description

Use the mobileAdCreate to place an add of a given type.

Place an ad of the given type. If no type is specified, a banner ad is placed. On Android, the Internet permissions checkbox must be ticked in the Standalone Application Settings. It is also recommended that both the fine and coarse location checkboxes are ticked. This allows the ad served to be tailored to the user's location. On iOS, the location of the user can be set directly in the meta data.

Parameters

NameTypeDescription

ad

The name of the ad to create. This is used to reference the ad throughout its lifetime.

type

enum

The ad type.

topLeft

The location of the top left corner of the ad (coordinates are in left,top - x,y order) in pixels. The default is: 0,0

metaData

An array of values that are used to target the ad. The keys are as follows:

  • "phone number": The user's mobile number (MSISDN format with international prefix).
  • "keywords": Keywords relevant to the user's specific session. This is comma separated without spaces.
  • "gender": The expected gender of the target user. The allowed values are M, m, Male, F, f, Female.
  • "distribution id": The distribution Channel ID (559 for banner ads and full screen ads, 600 for text ads).
  • "refresh": A value in seconds that defines how often the ad should refresh. Values are between 30 and 300 seconds. The default is 120 seconds.
  • "age": An integer defining the expected age of the target user.
  • "coordinates": GPS ISO code location data in latitude, longitude format. - (iOS only)
  • "location": A comma delimited list of country, state/province, city. - (iOS only)

Examples

mobileAdCreate "Ad1", "text", (0,0), tMetaData

command: mobileAdRegister, mobileAdDelete

function: mobileAds

Compatibility and Support

Introduced

LiveCode 5.5

OS

ios

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?